import axios from 'axios';

axios.withCredentials = true
axios.defaults.timeout = 1000000000; //请求超时10秒
axios.defaults.baseURL = 'http://lianpeiwang.ip189.lhyw.net/'; //请求base url
// axios.defaults.baseURL ='http://glc.ilianpei.com/'; //请求base url
// axios.defaults.baseURL = process.env.BASE_URL
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; //设置post请求是的header信息

export default {
    //post请求
    requestPost(url, params = {}) {
        return new Promise((resolve, reject) => {
            axios.post(url, params).then(response => {
                resolve(response.data);
            }).catch(error => {
                reject(error)
            })
        })
    }
}